#ifndef INDICATORS_H
#define INDICATORS_H

#include <stdbool.h>
#include <stdio.h>
#include "lvgl/lvgl.h"


// 指示灯状态结构体
typedef struct {
    bool state;            // 当前状态
    lv_obj_t *on_obj;      // 开启状态的UI对象
    lv_obj_t *off_obj;     // 关闭状态的UI对象
} Indicator;

// 外部可见的指示灯状态
extern bool left_turn_signal_on;
extern bool right_turn_signal_on;
extern bool hazard_lights_on;
extern bool qianchegai_on;
extern bool houchegai_on;
extern bool aqdjs_on;
extern bool shache_on;
extern bool fadongji_on;
extern bool jinguangdeng_on;
extern bool yuanguangdeng_on;
extern bool aqqn_on;
extern bool chemen_on;
extern bool qwzd_on;
extern bool hwzd_on;
extern bool youya_on;
extern bool qwd_on;
extern bool hwd_on;
extern bool shuangshan_on;
extern bool abs_active; 
extern bool eco_on;

extern bool wxzsd_on;
extern bool zhudong_on;
extern bool dlfz_on;
extern bool youliangdeng_on;
extern bool cldc_on;
extern bool cheliangzitai_on;
extern bool cheliangxinhao_on;
extern bool chaosutixing_on;
extern bool yugua_on;
extern bool xiansu_on;
extern bool aqzsd_on;
extern bool chelianwang_on;
extern bool zdjs_on;
extern bool lqyd_on;
extern bool clgy_on;
extern bool tyjg_on;

extern bool ldxt_on;
extern bool ysxt_on;
extern bool zny_on;
extern bool zqtxh_on;
extern bool zhtxh_on;
extern bool yqtxh_on;
extern bool yhtxh_on;


// 转向灯动画状态
extern bool is_left_signal_animating;
extern bool is_right_signal_animating;

/**
 * @brief 更新单个指示灯状态
 * @param ind 指示灯结构体指针
 * @param new_state 新状态
 */
void update_indicator(Indicator *ind, bool new_state);

/**
 * @brief 更新所有指示灯状态
 */
void update_all_indicators();

/**
 * @brief 初始化指示灯模块
 */
void init_indicators();


#endif // INDICATORS_H